import departments from '@/router/modules/departments'

// ⭐store/index.js中的根getters
const getters = {
  // ⭐通过getters建立对子模块state的快捷访问
  sidebar: (state) => state.app.sidebar,
  device: (state) => state.app.device,
  token: (state) => state.user.token,
  // 获取 ajax请求后存到user模块的用户数据
  userId: (state) => state.user.userInfo.userId,
  username: (state) => state.user.userInfo.username,
  staffPhoto: (state) => state.user.userInfo.staffPhoto,
  departmentName: (state) => state.user.userInfo.departmentName,
  companyName: (state) => state.user.userInfo.companyName
}
export default getters

// eg: mapGetters(['sidebar]) 读取到了app模块中state的sidebar
// eg: mapGetters(['device]) 读取到了app模块中state的device
